﻿using DataAccessLayer;
using DataAccessLayer.DatabaseOperations;
using MasterEntities;
using MasterEntities.Abstraction;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Client.TestConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            //FizickoLice fl = new FizickoLice
            //{
            //    Id = 34,
            //    Jezik = "srpski",
            //    Naziv = "Danilo Andjelic 22",
            //    Ime = "Danilo",
            //    Prezime = "Andjelic test 22"
            //};

            //AbstractExecutionTemplate execution = new Create();
            //bool result = execution.ExecuteOperation(fl);
            //Console.WriteLine("create result " + result.ToString());

            IGenericDataAccessLayer dal = new GenericDataAccessLayer();

            List<IDomainObject> list = dal.GetAll<FizickoLice>();

            if (list != null && list.Count() > 0)
                foreach (IDomainObject item in list)
                    Console.WriteLine(item.ToString());

            IDomainObject ent = dal.GetEntity<FizickoLice>("fi.Id = 1");

            List<IDomainObject> listOfPravnaLica = dal.GetAll<PravnoLice>();
            foreach (PravnoLice item in listOfPravnaLica)
                Console.WriteLine("pravno lice: " + item.Naziv);

            List<IDomainObject> listOfBase = dal.GetAll<Osoba>();

            Console.ReadLine();
                
        }
    }
}
